function changeTitle() {
    document.getElementById("divTitle").innerHTML = document.getElementById("cars").value;
    currentcarid = document.getElementById("cars").value;
    $.ajax({
        type: "get",
        url : "packet/"+currentcarid,
        data: {meterId:"meterId"},
        dataType: "json",
        success: function(data){
            if(data){
                datarequired = [];
                for(var i = data.length-1 ; i >=0; i--){
                    datarequired.push(data[i]);
                }
                showChart1();
                showChart2();
                showChart3();
                showChart4();
                eneryChart();
                showChart();
            }
        },
        error: function(errmsg) {
            alert("Ajax获取服务器数据出错了！"+ errmsg);
        }
    });
    //alert(document.getElementById("cars").value);
}
var tempid
function ChooseButton(){
    $("#cars").empty();//清空select列表数据
    $.ajax({
        type : "get",
        async:false,
        url : "mappings",
        dataType : "json",
        data : {},
        success : function(data)
        {
            tempid = data[0]['meterId'];
            for (var i = 0; i < data.length; i++) {

                //如果在select中传递其他参数，可以在option 的value属性中添加参数
                //$("#selectSM").append("<option value='"+msg.rows[i].id+"'>"+msg.rows[i]+"</option>");

                $("#cars").append("<option value='"+data[i]['meterId']+"'>"+data[i]['carId']+"</option>");
            }
        },error:function(errmsg){
            alert("Ajax获取服务器数据出错了！"+ errmsg);
        }
    });
}